//
//  HYCSecondPushDisCell.m
//  FamilyTravel
//
//  Created by dllo on 15/10/24.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HYCSecondPushDisCell.h"
#import "HYCSecondPushDisModel.h"
#import <UIImageView+WebCache.h>
#define WIDTH self.contentView.frame.size.width
#define HEIFGT self.contentView.frame.size.height
@implementation HYCSecondPushDisCell



- (void)dealloc {
    [_view release];
    [_tuImageView release];
    [_enLable release];
    [_cnLable release];
    
    
    
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}
- (void)createCell {
    self.view = [[UIView alloc] init];
//            self.view.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.view];
    //    self.view.layer.borderWidth = 1;
    //    self.view.layer.cornerRadius = 10;
    [_view release];
    
    self.tuImageView = [[UIImageView alloc] init];
    [self.view addSubview:self.tuImageView];
        self.tuImageView.backgroundColor = [UIColor yellowColor];
    self.tuImageView.layer.borderWidth = 1;;
    self.tuImageView.layer.cornerRadius = 10;
    self.tuImageView.layer.masksToBounds = YES;
    [_tuImageView release];
    
    self.enLable = [[UILabel alloc] init];
    [self.view addSubview:self.enLable];
    [_enLable release];
    self.enLable.font = [UIFont systemFontOfSize:16];
    self.enLable.numberOfLines = 0;

 
    
    
    
    self.cnLable = [[UILabel alloc] init];
    [self.view addSubview:self.cnLable];
    [_cnLable release];
    self.cnLable.font = [UIFont systemFontOfSize:20];
//    self.cnLable.backgroundColor = [UIColor whiteColor];
    

    
}
- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.view.frame = CGRectMake(0, 0, WIDTH, HEIFGT);
    self.tuImageView.frame = CGRectMake(10, 5, WIDTH - 20, HEIFGT / 1.125);
    self.cnLable.frame = CGRectMake(WIDTH / 2.34375, HEIFGT / 3.2727, WIDTH / 4.6875, HEIFGT / 5.1428);
    self.enLable.frame = CGRectMake(WIDTH / 2.3437, HEIFGT / 2, WIDTH / 4.6875, HEIFGT / 6);

}

#pragma mark -  Setter Method
- (void)setModel:(HYCSecondPushDisModel *)model {
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
        
        _enLable.text = _model.enname;
        _cnLable.text = _model.cnname;
        
        [_tuImageView sd_setImageWithURL:[NSURL URLWithString:_model.photo]placeholderImage:[UIImage imageNamed:@"zw.png"]];

        
        
        
    }
}
- (void)awakeFromNib {

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
